import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ACLGuard } from '@delon/acl';
import { TeacherViewComponent } from 'src/app/project/component/icm-system-user/teacher/teacher-view.component';
import { StudentViewComponent } from 'src/app/project/component/icm-system-user/student/student-view.component';
import { UserViewComponent } from 'src/app/project/component/icm-system-user/user/user-view.component';

const routes: Routes = [
  {
    path: 'user',
    canActivate: [ACLGuard],
    component: UserViewComponent,
    data: {
      title: '用户管理',
      reuse: true,
      guard: {
        role: ['ROLE_ADMIN', 'ROLE_SENATOR'],
      },
    },
  },
  {
    path: 'teacher',
    canActivate: [ACLGuard],
    component: TeacherViewComponent,
    data: {
      title: '教师管理',
      reuse: true,
      guard: {
        role: ['ROLE_SENATOR', 'ROLE_INSTRUCTOR'],
      },
    },
  },
  {
    path: 'student',
    canActivate: [ACLGuard],
    component: StudentViewComponent,
    data: {
      title: '学生管理',
      reuse: true,
      guard: {
        role: ['ROLE_SENATOR', 'ROLE_INSTRUCTOR'],
      },
    },
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class SystemUserRoutingModule {}
